import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: HomeView,
    redirect: '/sys-admin/index', // 重定向
    children: [
      {
        path: '/sys-admin/index',
        component: () => import('../views/sys-admin/SystemAdminIndex.vue')
      },
      {
        path: '/sys-admin/temp/dishes/add-new',
        component: () => import('../views/sys-admin/temp/DishesAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/dishes/list',
        component: () => import('../views/sys-admin/temp/DishesListView.vue')
      },
      {
        path: '/sys-admin/temp/admin/add-new',
        component: () => import('../views/sys-admin/temp/AdminAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/admin/list',
        component: () => import('../views/sys-admin/temp/AdminListView.vue')
      },
      {
        path: '/sys-admin/temp/picture/add-new',
        component: () => import('../views/sys-admin/temp/PictureAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/picture/list',
        component: () => import('../views/sys-admin/temp/PictureListView.vue')
      },
      {
        path: '/sys-admin/temp/category/add-new',
        component: () => import('../views/sys-admin/temp/CategoryAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/category/list',
        component: () => import('../views/sys-admin/temp/CategoryListView.vue')
      },
      {
        path: '/sys-admin/temp/user/add-new',
        component: () => import('../views/sys-admin/temp/UserAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/user/list',
        component: () => import('../views/sys-admin/temp/UserListView.vue')
      },
      {
        path: '/sys-admin/temp/store/add-new',
        component: () => import('../views/sys-admin/temp/StoreAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/store/list',
        component: () => import('../views/sys-admin/temp/StoreListView.vue')
      },
      {
        path: '/sys-admin/temp/table/add-new',
        component: () => import('../views/sys-admin/temp/TableAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/table/list',
        component: () => import('../views/sys-admin/temp/TableListView.vue')
      },
      {
        path: '/sys-admin/temp/member/add-new',
        component: () => import('../views/sys-admin/temp/MemberAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/member/list',
        component: () => import('../views/sys-admin/temp/MemberListView.vue')
      },
      {
        path: '/sys-admin/temp/comment/add-new',
        component: () => import('../views/sys-admin/temp/CommentAddNewView.vue')
      },
      {
        path: '/sys-admin/temp/comment/list',
        component: () => import('../views/sys-admin/temp/CommentListView.vue')
      },
    ]
  },
  {
    path: '/login',
    component: () => import('../views/LoginView.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router

